package com.lam.task.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lam.common.utils.DateUtil;
import com.lam.task.mapper.SystemMapper;

@Service
public class SystemService {
	
	@Autowired
	private SystemMapper systemMapper;
	
	@Transactional
	public int deleteScheduleLog(String limitDate) {
		
		return systemMapper.deleteScheduleLog(limitDate);
	}
	
	@Transactional
	public int deleteOperLog(String limitDate) {
		
		return systemMapper.deleteOperLog(limitDate);
	}
	
	@Transactional
	public int updateFileStatus() {
		
		return systemMapper.updateFileStatus(DateUtil.getCurDate());
	}

	@Transactional
	public int deleteFileRecord(int dayCount) {
		String limitDate = DateUtil.getDurationDateStr(-dayCount);
		return systemMapper.deleteFileRecord(limitDate);
	}
	
}
